package com.greenhouse.mapper.glogs;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface AlertsMapper {
    //创建预警表
    @Insert("CREATE TABLE ${name} (" +
            "id INT AUTO_INCREMENT PRIMARY KEY COMMENT '预警ID'," +
            "greenhouse_id INT COMMENT '所属大棚ID'," +
            "alert_type int COMMENT '预警类型'," +
            "message TEXT COMMENT '预警信息'," +
            "triggered_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '触发时间'"+
            ") COMMENT='预警信息表';")
    Integer createAlerts(@Param("name") String name);
}
